package kr.hikt.androidcomplete01.ch07;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.View;

public class TypeFace extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(new MyView(this));
	}
	
	class MyView extends View{
		private Paint pnt;
		private int y = 1;
		
		public MyView(Context context){
			super(context);
			pnt = new Paint();
		}

		@Override
		protected void onDraw(Canvas canvas) {
			super.onDraw(canvas);
			canvas.drawColor(Color.LTGRAY);
			
			pnt.setAntiAlias(true);
			pnt.setTextSize(30);
			pnt.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.NORMAL));
			canvas.drawText("Font:Default", 10, y++ * 40, pnt);
			pnt.setTypeface(Typeface.create(Typeface.DEFAULT_BOLD, Typeface.NORMAL));
			canvas.drawText("Font:Default Bold", 10, y++ * 40, pnt);
			pnt.setTypeface(Typeface.create(Typeface.MONOSPACE, Typeface.NORMAL));
			canvas.drawText("Font:Monospace", 10, y++ * 40, pnt);
			pnt.setTypeface(Typeface.create(Typeface.SANS_SERIF, Typeface.NORMAL));
			canvas.drawText("Font:Sans Serif", 10, y++ * 40, pnt);
			pnt.setTypeface(Typeface.create(Typeface.SERIF, Typeface.NORMAL));
			canvas.drawText("Font:Serif", 10, y++ * 40, pnt);
		}
		
		
	}
}
